enum Evisible {
    /** 只判断display状态 */
    display = 'display',
    /** 只判断visibility状态 */
    visibility = 'visibility',
    /** 同时判断display状态和visibility状态 */
    both = 'both',
}

interface KHTMLElement {
    /**
     * 判断元素是否为显示状态
     * @param visible <'display'> 显示属性 @see Evisible
     * @returns true: 元素为显示状态; false: 元素为隐藏状态;
     */
    isShow(visible?: Evisible): boolean;
}
{
    Object.defineProperty(KHTMLElement.prototype, 'isShow', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: function (this: KHTMLElement, visible = Evisible.display) {
            switch (visible) {
                case Evisible.display: return this.getStyle('display', true) !== 'none';
                case Evisible.visibility: return this.getStyle('visibility', true) !== 'hidden';
                case Evisible.both: return this.getStyle('display', true) !== 'none' && this.getStyle('visibility', true) !== 'hidden';
                default: throw new IllegalArgumentError();
            }
        }
    });
}
